﻿<UserControl x:Class="GrooveSharp.CurrentPlayList"
             xmlns:local="clr-namespace:GrooveSharp"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="494">

    <UserControl.Resources>
        <ResourceDictionary Source="/Resources/GlassButton.xaml" />
    </UserControl.Resources>

    <DockPanel LastChildFill="True">

        <UniformGrid Columns="2" DockPanel.Dock="Bottom" >
            <StackPanel  Orientation="Horizontal" >
                <Button Name="removeButton" Margin="5" Style="{StaticResource GlassButtonMedium}" Click="removeButton_Click">
                    <Image Source="/Images/minus.png" Style="{StaticResource ImageForMedium}" />
                </Button>
            </StackPanel>

            <Popup Name="popLink" StaysOpen="False" Placement="Mouse" Closed="popLink_Closed">
                <local:TrackPopupInfo x:Name="popupInfo">
                </local:TrackPopupInfo>
            </Popup>
        </UniformGrid>

        <ListView Name="listViewCurrentPlayList" SelectionMode="Extended" MouseRightButtonUp="listViewCurrentPlayList_MouseRightButtonUp">

            <ListView.ItemContainerStyle>
                <Style TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource GrooveSharpListViewItem}">
                </Style>
            </ListView.ItemContainerStyle>

            <ListView.View>
                <GridView>
                    <GridView.Columns>
                        <GridViewColumn Header="Playing" Width="40"  >
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <RadioButton IsChecked="{Binding Playing}" Tag="{Binding Id}" Click="RadioButton_Click" GroupName="NowPlaying" >
                                        <RadioButton.Template>
                                            <ControlTemplate TargetType="RadioButton">
                                                <Canvas Width="16" Height="16">
                                                    <Path Name="marker" Fill="Gray" Data="M 2,2 L 2,10 L 10,10 L 10,2 L 2,2"/>
                                                </Canvas>
                                                <ControlTemplate.Triggers>
                                                    <Trigger Property="IsChecked" Value="True">
                                                        <Setter TargetName="marker" Property="Fill" Value="Gold"/>
                                                        <Setter TargetName="marker" Property="Data" Value="M 0,0 L 0,16 L 16,6 L 0,0"/>
                                                    </Trigger>
                                                </ControlTemplate.Triggers>
                                            </ControlTemplate>
                                        </RadioButton.Template>
                                    </RadioButton>
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                        <GridViewColumn Header="Artist" DisplayMemberBinding="{Binding Artist}"  />
                        <GridViewColumn Header="Album"  DisplayMemberBinding="{Binding Album}" />
                        <GridViewColumn Header="Title" DisplayMemberBinding="{Binding Title}" />
                        <GridViewColumn Header="Year" DisplayMemberBinding="{Binding Year}" />
                        <GridViewColumn Header="Rating" >
                            <GridViewColumn.CellTemplate>
                                <DataTemplate>
                                    <local:Rating Tag="{Binding Id}" RatingValue="{Binding Path=Rating, Mode=TwoWay}" RatingChanged="Rating_RatingChanged" />
                                </DataTemplate>
                            </GridViewColumn.CellTemplate>
                        </GridViewColumn>
                    </GridView.Columns>
                </GridView>
            </ListView.View>
        </ListView>
        
        
    </DockPanel>
</UserControl>
